﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ventas.Data;
using Ventas.Data.Entities;

namespace Ventas.Web
{
    public partial class Default : System.Web.UI.Page
    {
        //
        protected void Page_Load(object sender, EventArgs e)
        {
            Label1.Text = List();
        }
        //
        private string List()
        {
            string r = "";
            using (VentasDbContext ctx = new VentasDbContext())
            {
                var list = ctx.Categorys.Where(u => u.Name.Contains("K")).ToList();
                foreach (Category value in list)
                { 
                    r += value.Name +"<br>";
                }
            }
            return r;
        }
    }
}